package com.pxmeta.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pxmeta.user.entity.ShareReward;
import com.pxmeta.user.entity.vo.ShareRewardVO;
import com.pxmeta.user.mapper.ShareRewardMapper;
import com.pxmeta.user.service.IShareRewardService;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ShareRewardServiceImpl extends ServiceImpl<ShareRewardMapper, ShareReward> implements IShareRewardService {

    @Override
    public ShareRewardVO getShareRewards(Long userId) {
        LambdaQueryWrapper<ShareReward> wrapper = Wrappers.lambdaQuery();
        wrapper.orderByAsc(ShareReward::getShareCount);
        List<ShareReward> list = this.list(wrapper);
        ShareRewardVO vo = new ShareRewardVO();
        vo.setList(list);
        vo.setCurrentShareCount(0);
        return vo;
    }
}
